import 'package:flutter/material.dart';
import 'package:flutterproject/util/extension/extension_util.dart';
import 'package:flutterproject/util/margin_padding_util.dart';
import 'package:flutterproject/widget/app_bar_common.dart';
import 'package:flutterproject/widget/keep_alive_wrapper.dart';

import 'tong_piao.dart';
import 'yi_dai.dart';

class YunCharge extends StatelessWidget {
  final int? walletId;

  const YunCharge({super.key, this.walletId});

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child: Container(
        color: Color(0xFFF6F6F6),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            AppBarCommon(
              title: "酝积分充值",
              bgColor: Color(0xFFEDC88B),
              leftColor: Colors.white,
              titleColor: Colors.white,
            ),
            TabBar(
              tabs: [
                Tab(text: '用易货额度充值'),
                Tab(text: '用通票充值'),
              ],
              indicatorColor: Color(0xFFEDC88B),
              labelColor: Color(0xFFEDC88B),
              unselectedLabelColor: Color(0xFF414141),
              padding: MarginPaddingUtil.all(0),
              indicatorSize: TabBarIndicatorSize.label,
              indicatorPadding: MarginPaddingUtil.symmetric(vertical: 30.width),
            ),
            Expanded(
              child: TabBarView(
                physics: NeverScrollableScrollPhysics(),
                children: [
                  KeepAliveWrapper(child: YiDai(walletId: walletId,)),
                  KeepAliveWrapper(child: TongPiao(walletId: walletId,)),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
